/*
 * Copyright 2010-2012 Susanta Tewari. <freecode4susant@users.sourceforge.net>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/*
* ComGLHoodView.java
*
* Created on November 15, 2007, 4:21 PM
 */
package gui.genomemap.view;

import gui.genomemap.event.event.WorkerEvent;
import gui.genomemap.event.event.WorkerInputEvent;
import gui.genomemap.tree.ViewTree;

import javautil.swing.tabbedPane.MyTabbedPane;

import javax.swing.JPanel;

/**
 *
 * @author  stewari1
 */
public class ProgCurveView extends View {


    // Variables declaration - do not modify//GEN-BEGIN:variables

    /** Field description */
    private javax.swing.JScrollPane jScrollPane1;

    /** Field description */
    private javax.swing.JScrollPane jScrollPane2;

    /** Field description */
    private javax.swing.JScrollPane jScrollPane3;

    /** Field description */
    private javax.swing.JSplitPane jSplitPane1;

    /** Field description */
    private javax.swing.JSplitPane jSplitPane2;

    /** Field description */
    private javautil.swing.tabbedPane.MyTabbedPane myTabbedPane;

    /** Field description */
    private javax.swing.JPanel outputModelPanel;

    /** Field description */
    private gui.genomemap.view.inputView.ProgCurveIView progCurveIView;

    /** Field description */
    private gui.genomemap.view.outputView.ProgCurveOView progCurveOView;

    /** Field description */
    private ViewTree viewTree;


    // End of variables declaration//GEN-END:variables

    /**
     * Creates new form ComGLHoodView
     */
    public ProgCurveView() {

        initComponents();


        // property setters
        setType(WorkerEvent.PROG_CURVE);


        // component setters.
        setInputView(progCurveIView);
        setOutputView(progCurveOView);
        setTree(viewTree);
        setDescription("Progress Curve");
        setManager(new ViewManager(this));


        // the following one must be called.
        addAllListeners();
    }

    /**
     * This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */


    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jSplitPane1      = new javax.swing.JSplitPane();
        jScrollPane1     = new javax.swing.JScrollPane();
        viewTree         = new ViewTree();
        myTabbedPane     = new javautil.swing.tabbedPane.MyTabbedPane();
        outputModelPanel = new javax.swing.JPanel();
        jSplitPane2      = new javax.swing.JSplitPane();
        jScrollPane2     = new javax.swing.JScrollPane();
        progCurveIView   = new gui.genomemap.view.inputView.ProgCurveIView();
        jScrollPane3     = new javax.swing.JScrollPane();
        progCurveOView   = new gui.genomemap.view.outputView.ProgCurveOView();

        jSplitPane1.setDividerLocation(220);
        jScrollPane1.setViewportView(viewTree);
        jSplitPane1.setLeftComponent(jScrollPane1);
        jSplitPane2.setDividerLocation(400);
        jSplitPane2.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
        jSplitPane2.setContinuousLayout(true);
        jScrollPane2.setViewportView(progCurveIView);
        jSplitPane2.setTopComponent(jScrollPane2);
        jScrollPane3.setViewportView(progCurveOView);
        jSplitPane2.setBottomComponent(jScrollPane3);

        javax.swing.GroupLayout outputModelPanelLayout =
            new javax.swing.GroupLayout(outputModelPanel);

        outputModelPanel.setLayout(outputModelPanelLayout);
        outputModelPanelLayout.setHorizontalGroup(
            outputModelPanelLayout.createParallelGroup(
                javax.swing.GroupLayout.Alignment.LEADING).addComponent(
                jSplitPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 501, Short.MAX_VALUE));
        outputModelPanelLayout.setVerticalGroup(
            outputModelPanelLayout.createParallelGroup(
                javax.swing.GroupLayout.Alignment.LEADING).addComponent(
                jSplitPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 564, Short.MAX_VALUE));
        myTabbedPane.addTab("Output Model", outputModelPanel);
        jSplitPane1.setRightComponent(myTabbedPane);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);

        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(
                jSplitPane1, javax.swing.GroupLayout.Alignment.TRAILING,
                javax.swing.GroupLayout.DEFAULT_SIZE, 732, Short.MAX_VALUE));
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(
                jSplitPane1, javax.swing.GroupLayout.Alignment.TRAILING,
                javax.swing.GroupLayout.DEFAULT_SIZE, 594, Short.MAX_VALUE));

    }    // </editor-fold>//GEN-END:initComponents

    @Override
    public void doProgCurveInput(WorkerInputEvent event) {
        getOutputView().enableRuntimeControl();
    }

    public MyTabbedPane getTabbedPane() {
        return myTabbedPane;
    }

    @Override
    public JPanel getOutputModelPanel() {
        return outputModelPanel;
    }
}
